package com.demo.dao;

import com.demo.model.Order;
import com.demo.model.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface OrderDao {
    @InsertProvider(type = com.demo.dao.mapper.OrderMapper.class, method = "insert")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    public int insert(Order order);

    @DeleteProvider(type = com.demo.dao.mapper.OrderMapper.class, method = "delete")
    public Integer delete(Integer id);

    @UpdateProvider(type = com.demo.dao.mapper.OrderMapper.class, method = "update")
    public Integer update(Order order);

    @SelectProvider(type = com.demo.dao.mapper.OrderMapper.class, method = "select")
    public List<Order> select(Integer userId);

    @SelectProvider(type = com.demo.dao.mapper.OrderMapper.class, method = "selectOne")
    public Order selectOne(Integer id);

    @SelectProvider(type = com.demo.dao.mapper.OrderMapper.class, method = "selectOneByUserId")
    public List<Order> selectOneByUserId(Integer userId);

}
